<?php 
$mktime=mktime(date('his'));
$tr=$mktime.'tr';
$divlistado=$mktime.'listado';
$carg=$mktime;
$i_edit = $this->For->img('iconos/icons/editar.png','Editar Datos del Funcionario','Editar');
$i_bor = $this->For->img('iconos/icons/borrar.png','Eliminar Datos del Funcionario','Eliminar');
$i_nuevo = $this->For->img('iconos/icons/nuevo.png','Nuevo Registro','Nuevo');

echo "<div id='$divlistado'><br /><br />";
?>
<table border='0' cellpadding='0' cellspacing='0' width='95%' align='center' style='border:10;'>
<tr>
<td>&nbsp;
</td>
<td width='62px'>
<?=$this->Json->tipsayuda('nuevo1','Haga Click para registrar un nuevo Funcionario','nuevo');?>
<div align='right' id='nuevo1' style="border-top: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
<div onclick="<?=$this->For->ajax('','Usuarios/nuevo/nuevo1/'.$divlistado,$carg);?>">
&nbsp;<?=$this->For->accion($i_nuevo);?></div>
</div>

</td>
</tr>

<tr>
<td colspan='2'>

<?

$this->Json->tipsayuda($tr,'Haga Doble Click sobre el listado para ampliar','listado');
$this->Json->lisamplia('t'.$mktime);
if(count($data)>0) {
$this->For->table($mktime);

$this->For->tr($mktime,'',$tr,1);
$this->For->td('<b>#</b>','','c','20px');
$this->For->td('<b>CEDULA</b>','','c');
$this->For->td('<b>NOMBRE</b>','','c');
$this->For->td('<b>APELLIDO</b>','','c');
$this->For->td('<b>USUARIO</b>','','c');
$this->For->td('<b>FECHA N.</b>','','c');
$this->For->td('<b>SEXO</b>','','c');
$this->For->td('<b>ESTATUS</b>','','c');
$this->For->td('<b>CONECTADO</b>','','c');
$this->For->td('<b>ACCION</b>','','c','60px');
$this->For->tr('');


for($z=0; $z<count($data); $z++){ 
if ($z % 2 == 0) $class = "#FFFFFF"; else $class = "#F0F0F0";
$id=$this->For->id('',$data[$z]['Usuario']['id']);$t1=$id.'ayuda';$t2=$id.'links';

$mode='Usuario';
$a=$data[$z][$mode]['cedula'];
$b=$data[$z][$mode]['nombre'];
$c=$data[$z][$mode]['apellido'];
$d=$data[$z][$mode]['usuario'];
$e=$this->For->fecha($data[$z][$mode]['fecha_nacimiento']);
$f=$data[$z][$mode]['sexo'];
$g=$data[$z][$mode]['estatus'];
if($g===0) $g=$this->Html->image('iconos/icons/delete.gif', array('border'=>'0', 'align'=>'absmiddle'));
else $g=$this->Html->image('iconos/icons/add.png', array('border'=>'0', 'align'=>'absmiddle'));
$h=$data[$z][$mode]['conectado'];
if($h===0) $h=$this->Html->image('iconos/icons/cross.gif', array('border'=>'0', 'align'=>'absmiddle'));
else $h=$this->Html->image('iconos/icons/accept.png', array('border'=>'0', 'align'=>'absmiddle'));



$this->Json->tipsayuda($t1,($z+1)." $a $b $c $e",'info',400);
//$this->Json->tipsayuda($t2,"$a $b $c",'modi',100);

$this->For->tr($mktime,$class,$t1);
$this->For->td(($z+1),$busq,'r');
$this->For->td($a,$busq);
$this->For->td($b,$busq);
$this->For->td($c,$busq);
$this->For->td($d,$busq);
$this->For->td($e,'','c','20px');
$this->For->td($f,$busq,'20px');
$this->For->td($g,'','c','20px');
$this->For->td($h,'','c','20px');
echo "<td width='10px' id='$t2'>";
?>

<div onclick="<?=$this->For->ajax('','Usuarios/micuenta/'.$t2.'/'.$divlistado.'/'.$id,$carg);?>">
&nbsp;<?=$this->For->accion($i_edit);?>
</div>

<?="</td>";$this->For->tr('');} $this->For->table(''); } else {
$this->For->table($mktime);
$this->For->tr($mktime,'#FFFFFF',$tr);
$this->For->td("<font color='red' size='-1'>No Se Encrontraron Registros con esa Busqueda </font>",'','c','100%');
$this->For->tr('');
$this->For->table('');

}?>

</td>
</tr>

<? if(count($data)>20) { ?>
<tr>
<td>&nbsp;
</td>
<td width='62px'>
<?=$this->Json->tipsayuda('nuevo2','Haga Click para registrar un nuevo Funcionario','nuevo');?>
<div align='center' id='nuevo2' style="border-bottom: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
<div onclick="<?=$this->For->ajax('','Usuarios/nuevo/nuevo2/'.$divlistado,$carg);?>">
&nbsp;<?=$this->For->accion($i_nuevo);?></div>
</div>
</td>
</tr>
<? } ?>
</table>
<? echo '<br /><br />'; echo'</div>';?>
<?="<div id='$carg'></div>";?>

<?//=$this->Json->listado();?>





